import dedup from "../../js/dedup"
let init = []
function commentReducer(preVal = init,action) {
    let { type, data } = action
    switch (type) {
        case 'comment':
            return dedup([...preVal, data])
        case 'clearComment':
            return preVal=data
        default:
            return preVal
    }
}
export default commentReducer